<%@page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Your scrum themes</title>
    <style type="text/css">
        #sortable {
            list-style-type: none;
            margin: 0;
            padding: 0;
            width: 60%;
        }

        #sortable li {
            margin: 0 3px 3px 3px;
            padding: 0.4em;
            padding-left: 1.5em;
            font-size: 1.4em;
            height: 18px;
        }

        span.listItemLabel {
            float: left
        }

        span.listItemAdd {
            float: right;
        }

        span.listItemChilds {
            float: right;
            font-size: small;
        }
    </style>
    <script type="text/javascript">

        function checkSortChanges() {

        }

        var myClick = function (event) {
            var location = $(event.target).children("a")[0].href;
            window.location = location;
        };

        $(function() {
            $("#sortable").sortable();
            $("#sortable").disableSelection();
            $("#sortable").bind('sortupdate', function(event, ui) {
                window.alert($("#sortable").sortable('serialize'));
            });
            $("#sortable li span.listItemAdd").addClass("ui-icon ui-icon-circle-plus").click(myClick);
        });
    </script>
</head>
<body>
<div id="list-of-themes">
    <ul id="sortable">
        <c:forEach items="${themes}" var="theme">
            <li id="theme_${theme.id.id}" class="ui-state-default"><span class="listItemLabel">${theme.name}</span><span
                    class="listItemAdd"><a
                    href="/theme/addStory.html?themeId=${theme.id.id}" title="add story">add</a></span><span
                    class="listItemChilds">stories(${theme.numberOfStories})</span></li>
        </c:forEach>
    </ul>
</div>
</body>
</html>